#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e6 + 5;
const int MOD = 10007;

int n, m;
ll a[N];
int f[N];
void init(int n) {
  f[0] = 1;
  rep(i, 1, n) f[i] = 1ll * f[i - 1] * i % MOD;
}
ll fastpow(ll b, ll p) {
  ll res = 1;
  while (p) {
    if (p & 1) res = res * b % MOD;
    b = b * b % MOD;
    p >>= 1;
  }
  return res;
}
ll inv(ll x) { return fastpow(x, MOD - 2); }
ll cmb(ll n, ll m) {
  if (m > n) return 0;
  ll res = 1ll * f[n] * inv(f[m]) % MOD * inv(f[n - m]) % MOD;
  // cout << n << ' ' << m << ' ' << res << endl;
  return res;
}
ll lucas(ll n, ll m) {
  if (m > n) return 0;
  if (m == n || m == 0) return 1;
  return lucas(n / MOD, m / MOD) * cmb(n % MOD, m % MOD) % MOD;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  init(MOD);
  cin >> n;
  rep(i, 1, n) a[i] = lucas(n - 1, (i - 1) / 2);
  ll ans = 0;
  rep(i, 1, n) ans = (ans + i * a[i]) % MOD;
  cout << ans;
  return 0;
}